package jmine.tec.script.persistent.driver;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import jmine.tec.script.persistent.dao.ScriptLanguageIdentifier;
import bancosys.tec.datadigester.DigesterBean;
import bancosys.tec.utils.date.Date;

/**
 * DigesterBean do driver de scripts do hydra.
 * 
 * @author lundberg
 */
public class ScriptBean implements DigesterBean {

    private boolean complete = false;

    private Date downloadTimestamp;

    private String mnemonico;

    private String descricao;

    private ScriptLanguageIdentifier languageIdentifier;

    private String finalidade;

    private List<String> apis = new ArrayList<String>();

    private Map<String, String> dependencies = new HashMap<String, String>();

    private String databaseId;

    private String body;

    /**
     * @return the complete
     */
    public boolean isComplete() {
        return this.complete;
    }

    /**
     * @param complete the complete to set
     */
    public void setComplete(boolean complete) {
        this.complete = complete;
    }

    /**
     * @return the downloadTimestamp
     */
    public Date getDownloadTimestamp() {
        return this.downloadTimestamp;
    }

    /**
     * @param downloadTimestamp the downloadTimestamp to set
     */
    public void setDownloadTimestamp(Date downloadTimestamp) {
        this.downloadTimestamp = downloadTimestamp;
    }

    /**
     * {@inheritDoc}
     * 
     * @see bancosys.tec.datadigester.DigesterBean#getFileDate()
     */
    public Date getFileDate() {
        if (this.downloadTimestamp == null) {
            this.downloadTimestamp = new Date();
        }
        return new Date(this.downloadTimestamp);
    }

    /**
     * {@inheritDoc}
     * 
     * @see bancosys.tec.datadigester.DigesterBean#getNumberOfItems()
     */
    public int getNumberOfItems() {
        return 1;
    }

    /**
     * @return the mnemonico
     */
    public String getMnemonico() {
        return this.mnemonico;
    }

    /**
     * @return the descricao
     */
    public String getDescricao() {
        return this.descricao;
    }

    /**
     * @return the languageIdentifier
     */
    public ScriptLanguageIdentifier getLanguageIdentifier() {
        return this.languageIdentifier;
    }

    /**
     * @return the finalidade
     */
    public String getFinalidade() {
        return this.finalidade;
    }

    /**
     * @return the apis
     */
    public List<String> getApis() {
        return this.apis;
    }

    /**
     * @return the dependencies
     */
    public Map<String, String> getDependencies() {
        return this.dependencies;
    }

    /**
     * @return the databaseId
     */
    public String getDatabaseId() {
        return this.databaseId;
    }

    /**
     * @return the body
     */
    public String getBody() {
        return this.body;
    }

    /**
     * @param mnemonico the mnemonico to set
     */
    public void setMnemonico(String mnemonico) {
        this.mnemonico = mnemonico;
    }

    /**
     * @param descricao the descricao to set
     */
    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    /**
     * @param languageIdentifier the languageIdentifier to set
     */
    public void setLanguageIdentifier(ScriptLanguageIdentifier languageIdentifier) {
        this.languageIdentifier = languageIdentifier;
    }

    /**
     * @param finalidade the finalidade to set
     */
    public void setFinalidade(String finalidade) {
        this.finalidade = finalidade;
    }

    /**
     * @param databaseId the databaseId to set
     */
    public void setDatabaseId(String databaseId) {
        this.databaseId = databaseId;
    }

    /**
     * @param body the body to set
     */
    public void setBody(String body) {
        this.body = body;
    }
}
